<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head th:replace="top::html" />
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>项目管理</title>
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

<body class="fixed hold-transition skin-blue">
    <div class="wrapper">

        <!-- Main Header -->
        <div th:replace="tophtml::html"></div>
        <!-- Left side column. contains the logo and sidebar -->
        <div th:replace="left::html"></div>

        <!-- Content Wrapper. Contains page content -->
        <div class="content-wrapper">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <h1>
                    <span>项目管理</span>
                    <small></small>
                </h1>
                <ol class="breadcrumb">
                    <li><a th:href="@{/index}"><i class="fa fa-dashboard"></i>用户中心</a></li>
                    <li><a href="">项目管理</a></li>
                </ol>
            </section>
            <!-- Main content -->
            <section class="content container-fluid">
                <form th:action="@{/project/showConditionQuery}" method="get" id="from1">
                    <input type="hidden" name="pageNo" id="pageNo" />
                    <div class="form-group">
                        <input style="width: 500px; display: inline" type="text" class="form-control" placeholder="id或名称" name="searchKeyword" th:value="${searchKeyword}">
                    </div>
                    <div class="form-group">
                        <label>项目类型</label>
                        <span th:each="ptd : ${projectTypeDictiontryList}">
                            <label style="font-weight: lighter;">
                                <input type="checkbox" name="projectType" th:value="${ptd.names}" th:text="${ptd.worth}" th:checked="${projectTypedArr != null ? #arrays.contains(projectTypedArr, ptd.names) : false}">
                            </label>
                        </span>
                    </div>
                    <div class="form-group">
                        <label>所属领域</label>
                        <span th:each="rfd : ${researchFieldDictiontryList}">
                            <label style="font-weight: lighter;">
	                            <input type="checkbox" name="researchField" th:value="${rfd.names}" th:text="${rfd.worth}" th:checked="${researchFieldArr != null ? #arrays.contains(researchFieldArr, rfd.names) : false}">
                            </label>
                        </span>
                    <button type="submit" class="btn btn-primary" style="margin-left: 40px;">搜索</button>
                    <!-- 重置按钮 -->
                    <button type="reset" class="btn btn-primary" style="margin-left: 40px;">重置</button>
                    <!-- 添加按钮 -->
                    <button type="button" class="btn btn-primary" onclick="javascript:window.location.href='/project/showAdd'" style="margin-left: 40px;">添加</button>
                    </div>
                    
                    <div>
                        <span class="from-group">
                            <label>国内国外</label>
                            <label style="font-weight: lighter;">
                                <input type="radio" name="domesticOrForeign" id="optionsRadios1" value="0" th:checked="${project != null ? project.domesticOrForeign == 0 : false}"> 国内
                            </label>
                            <label style="font-weight: lighter;">
                                <input type="radio" name="domesticOrForeign" id="optionsRadios2" value="1" th:checked="${project != null ? project.domesticOrForeign == 1 : false}"> 国外
                            </label>
                        </span>
                        <span class="form-group form-area">
                            <select class="form-area" id="provinceId">
                                <option value="-1">--选择省--</option>
                                <option th:each="list:${provinceDictiontryList}" th:value="${list.names}" th:text="${list.worth}" th:selected="${list.names eq province}"></option>
                            </select>
                        </span>
                        <span class="form-group form-area">
                            <select class="form-area" id="cityId">
                                <option value="-1">--选择市--</option>
                                <option th:each="list:${cityDictiontryList}" th:value="${list.names}" th:text="${list.worth}" th:selected="${list.names eq city}"></option>
                            </select>
                        </span>
                        <span class="form-group form-area">
                            <select class="form-area" id="areaId">
                                <option value="-1">--选择区--</option>
                                <option th:each="list:${areaDictiontryList}" th:value="${list.names}" th:text="${list.worth}" th:selected="${list.names eq district}"></option>
                            </select>
                        </span>
                        <span class="form-group form-country">
                            <select class="form-area">
                                <option value="-1">--选择国家--</option>
                                <option th:each="list:${countryDictiontryList}" th:value="${list.pid}" th:text="${list.worth}" th:selected="${list.pid eq country}"></option>
                            </select>
                        </span>
                    </div>

                </form>
                <!-- <form th:action="@{/project/importProject}" method="post"  enctype="multipart/form-data">
                    <table>
                        <tr>
                            <td>
			                    <input type="file" name="file">
                            </td>
                            <td>
			                    <button type="submit" class="btn btn-primary">导入</button>
                            </td>
                        </tr>
                    </table>
                </form> -->
                
                <div class="box">
                    <div class="box-body">
                        <table class="table table-bordered">
                            <tbody>
                                <tr>
                                    <th>项目id</th>
                                    <th>项目名称</th>
                                    <th>项目类型</th>
                                    <th>项目状态</th>
                                    <th>联系人</th>
                                    <th>操作</th>
                                </tr>
                                <tr th:each="project : ${pageInfo.list}">
                                    <td title="查看项目详情">
                                        <a th:href="@{'/project/showDetail?projectId='+${project.pid}}" th:text="'R' + ${project.projectNumber}">查看详情</a>
                                    </td>
                                    <td width="25%">
                                        <div class="col-md-3" style="width:100%;font-size: 14px;">
                                            <div class="box box-default collapsed-box" style="border-top:0px solid #d2d6de;">
                                                <div class="box-header with-border">
                                                    <span th:if="${#strings.length(project.projectName)>20}">
                                                        <span th:text="${#strings.substring(project.projectName,0,20)+'......'}"></span>
                                                    </span>
                                                    <span th:unless="${#strings.length(project.projectName)>20}">
                                                        <span th:text="${project.projectName}"></span>
                                                    </span>
                                                    <div class="box-tools pull-right" th:if="${#strings.length(project.projectName)>20}">
                                                        <button type="button" class="btn btn-box-tool" data-widget="collapse">
                                                            <i class="fa fa-plus"></i>
                                                        </button>
                                                    </div>
                                                </div>
                                                <div class="box-body">
                                                    <span th:text="${project.projectName}"></span>
                                                </div>
                                            </div>
                                        </div>
                                    </td>
                                    <td th:text="${project.projectType}">类型</td>
                                    <td th:text="${project.projectStatusWorth}">状态</td>
                                    <td>
                                        <a th:href="@{'/project/showUpdateContact?projectContactId='+${project.per == null ? '' : project.per.pid}}" th:text="${project.per == null ? '' : project.per.name}">联系人</a>
                                    </td>
                                    <td>
                                        <a th:href="@{'/project/showUpdate?projectId='+${project.pid}}">修改</a>
                                        <a th:unless="${project.per}" th:href="@{'/project/showAddContact?projectId='+${project.pid}}">添加联系人</a>|
                                        <a th:href="@{'/project/showHolders?projectId='+${project.pid}}">持有人管理</a>|
                                        <a th:href="@{'/demand/showProjectMatchedDemand?pid='+${project.pid}}">匹配需求</a>|
                                        <a th:href="@{'/customer/showProjectMatchedCustomer?pid='+${project.pid}+'&projectNumber='+${project.projectNumber}+'&projectName='+${project.projectName}}">匹配客户</a><br>
                                        <!-- <a th:href="@{'/project/showButtDetail?projectId='+${project.pid}'}">对接详情</a> -->
                                        <a th:href="@{'/project/showDemandButtDetail?projectId='+${project.pid}}">对接需求详情</a>|
                                        <a th:href="@{'/project/showCustomerButtDetail?projectId='+${project.pid}}">对接客户详情</a>|
                                        <a href="javascirpt:void(0)" th:onclick="'javascript:subscribe(\''+${project.pid}+'\',1)'">关注</a>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <p style="color: red;" th:text="${notHolderUpdate}"></p>
                        <p style="color: red;" th:text="${projectContactExists}"></p>
                        <p style="color: red;" th:text="${projectContactNotExists}"></p>
                        <div th:replace="page::html"></div>
                    </div>
                </div>
            </section>
        </div>
        <!-- Main Footer -->
        <div th:replace="footer::html"></div>
        <div class="control-sidebar-bg"></div>
    </div>
    <div th:replace="bottom::html"></div>
</body>

</html>